package cn.itsource.client;

import cn.itsource.domain.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.ApplicationContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//@RequestMapping("/order")
//@FeignClient(value = "ORDER-SERVICE",fallbackFactory = OrderServiceClientFallbackFactory.class) //标识是openfeign接口，设置要调佣服务名
@FeignClient(value = "ORDER-SERVICE",fallback = OrderServiceClientImpl.class) //标识是openfeign接口，设置要调佣服务名
public interface OrderServiceClient {
    @GetMapping("/order/{id}")
    Order getById(@PathVariable("id") Long id) throws Throwable;
}

